package top.gbiot.report.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.gbiot.common.domain.DataMap;
import top.gbiot.report.mapper.ReportMapper;

import java.util.List;

/**
 * 模态窗口
 * 
 * @author ruoyi
 */
@Controller
@RequestMapping("/iot/report")
public class ReportController
{
    private String prefix = "iot/report";

    @Autowired
    private ReportMapper reportMapper;

    /**
     * 进入数据报表主页面
     * @return
     */
    @GetMapping("dataReport")
    public String project()
    {
        return prefix + "/dataReport";
    }

    @GetMapping("/findAllDeviceData")
    @ResponseBody
    public List<DataMap> findAllDeviceData(String dataType,String deviceSn) {
        return reportMapper.findAllDeviceData(dataType,deviceSn);
    }

    /**
     * 进入我的项目主页面
     * @return
     */
    @GetMapping("myProject")
    public String myProject()
    {
        return prefix + "/myProject";
    }




}
